<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<title>南宁卫生监督公示查询－首页</title>

		<link rel="stylesheet" href="css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="css/icons-extra.css" />
		<link rel="stylesheet" type="text/css" href="css/style.css">
		<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_967424_y6xrk8je5d.css"/>
		<style type="text/css">
			#nav {
				background: ghostwhite;
				height: 55px;
				border-top: 1px solid #d8d8d8;
			}
			.icon-paihangbang{
				font-size: 20px;
			}
			.mui-tab-item span{
				display: block;
			}
		</style>
	</head>

	<body bgcolor="#f4f4f4">
		<div class="mui-content indexbg">

		</div>
		<nav class="mui-bar mui-bar-tab" id="nav">
			<a class="mui-tab-item mui-active" id="0">
				<span class="iconfont icon-weibiaoti--"></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item" id="1">
				<span class="iconfont icon-paihangbang"></span>
				<span class="mui-tab-label">排行</span>
			</a>
			<a class="mui-tab-item" id="2">
				<span class="iconfont icon-weibiaoti--1"></span>
				<span class="mui-tab-label">我的</span>
			</a>
		</nav>
	</body>

</html>

<script src="js/jquery.js "></script>
<script src="js/mui.min.js "></script>

<script type="text/javascript " charset="utf-8 ">
	mui.plusReady(function() {
		//设置默认打开首页显示的子页序号
		var Index = 0;
		//把子页面路径写在数组里面
		var subpages = ['home.html', 'paihang.html','my.html']
		//获取当前页面所属的Webview窗口对象
		var self = plus.webview.currentWebview();
		for(var i = 0; i < subpages.length; i++) {
			//创建webview子页
			var sub = plus.webview.create(
				subpages[i], //子页url
				subpages[i], //子页id
				{
					top: '0px',
					bottom: '55px',
					scrollIndicator: "none ", //隐藏滚动条
				}
			);
			//如果不是我们设置的子页就隐藏
			if(i != Index) {
				sub.hide()
			}
			//将webview对象填充到窗口
			self.append(sub)
		}

		//当前激活选项
		var activeTab = subpages[Index]
		var targetTab;
		mui('.mui-bar-tab').on('tap', 'a', function(e) {

			//获取子页面的id
			var j = this.getAttribute('id')
			targetTab = subpages[j]
			if(activeTab == targetTab) {
				return
			}

			//显示目标选项卡
			plus.webview.show(targetTab)
			//隐藏当前选项卡
			plus.webview.hide(activeTab)
			//更改当前活跃选项卡
			activeTab = targetTab
		})
	})
</script>